<?php

namespace app\topics\middle;

class TagsMiddle extends \app\base\middle\BaseMiddle {


    protected function meta() {
        $this->setMeta('话题');
        $this->setName('话题');
        $this->setCrumb([
            [
                'name' => '话题',
                'url' => url()
            ]
        ]);

        return $this->run([
            'pageInfo' => $this->pageInfo
        ]);
    }

    protected function data() {
        $pageParams = [];
        $where = [];
        $pageLimit = 20;
        $model = target('topics/TopicsTags');
        $count = $model->countList($where);
        $pageData = $this->pageData($count, $pageLimit);
        $list = $model->loadList($where, $pageData['limit'], 'quote desc');

        return $this->run([
            'pageData' => $pageData,
            'countList' => $count,
            'pageList' => $list,
            'pageParams' => $pageParams
        ]);
    }


}